package io.reader;

import framework.AbstractTest;
import utils.Log;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * Created by shane on 2018/5/20.
 */
public class BufferedReaderDemo extends AbstractTest {
    protected static final String TAG = BufferedReaderDemo.class.getName();

    @Override
    public void test(String[] args) {
        super.test(args);

        String testFilePath = getDefInputFile(args);

        try {
            BufferedReader bis = new BufferedReader(new FileReader(testFilePath));
            StringBuilder sb = new StringBuilder();
            String s;
            while ((s = bis.readLine()) != null) {
                sb.append(s + "\n");
            }
            bis.close();
            Log.v(sb.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected String getTag() {
        return TAG;
    }
}
